package sample.test.cc.testfile;

public class Process {

    private EventInfo ev;
    private boolean isOpen;
    private boolean isClose;
    private Long idTransactionClose;

    public Process() {
        isOpen=false;
        isClose=false;
    }

    public boolean isClose() {
        return isClose;
    }

    public long getIdTransactionClose() {
        return idTransactionClose;
    }

    public boolean isOpen() {
        return isOpen;
    }

    public void setIsClose(Long id) {
        this.isClose = true;
        this.isOpen = false;
        idTransactionClose=id;
    }

    public void setIsOpen() {
        this.isOpen = true;
        this.isClose = false;
    }

    public EventInfo getEvent() {
        return ev;
    }

    public void setEvent(Long idTransaccion, String recurso,String intention, Integer... value){
        this.isOpen = false;
        this.isClose = false;
        ev= new EventInfo();
        ev.setEvent(idTransaccion,recurso,intention,value);
    }

    @Override
    public String toString(){
        if(this.isClose){
            return "close "+String.valueOf(idTransactionClose);
        }
        if(this.isOpen){
            return "open";
        }
        return ev.toString();
    }

}
